home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MATH.SWG / 0013_PERMUTA4.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  486b  |  24 lines

  1. {
  2. > Does anyone have an idea to perForm permutations With pascal 7.0 ?
  3. > As an example finding the number of 5 card hands from a total of 52 car
  4. > Any help would be greatly appreciated.
  5.  
  6. }
  7.  
  8. Function Permutation(things, atatime : Word) : LongInt;
  9. Var
  10.   i : Word;
  11.   temp : LongInt;
  12. begin
  13.   temp := 1;
  14.   For i := 1 to atatime do
  15.   begin
  16.     temp := temp * things;
  17.     dec(things);
  18.   end;
  19.   Permutation := temp;
  20. end;
  21.  
  22. begin
  23.   Writeln('7p7 = ',Permutation(7,7));
  24. end.